{% extends "base.xhtml" %}

{% block title %}
  {{block.super}}: Musician Listing
{% endblock %}

{% block content %}
  <h1>Musicians</h1>

  <ul>
    {% for musician in musicians %}
      <li> <a href="{% url 'musician' musician.id %}">  #1
        {{musician.last_name}}, {{musician.first_name}}
      </a> </li>
    {% empty %}
      <li> <i>No musicians in the database</i> </li>
    {% endfor %}
  </ul>
  
  {% if page.has_other_pages %}
    {% if page.has_previous %}
      <a href="{% url 'musicians' %}?page={{page.previous_page_number}}"
          >Prev</a> &nbsp;&nbsp;&nbsp; #1
    {% endif %}
    {% if page.has_next %}
      <a href="{% url 'musicians' %}?page={{page.next_page_number}}"
          >Next</a>  #2
    {% endif %}
  {% endif %}

{% endblock content %}